<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jq/jquery-1.11.1.min.js"></script>
    <link rel="stylesheet" href="css/demo.css">
</head>
<body>
<div></div>
<div class="n_list"><ul></ul></div>

</body>
</html>
<script>
    $(function () {
        $.ajax({
            url:"http://127.0.0.1/zhiwoyangzhuang/severs/getGoods.php",
            type:"post",
            typeData:"json"
        }).then(function (res) {
            console.log(JSON.parse(res));
            var datas=JSON.parse(res || '[]');

            console.log(datas[0]["0"].I_img1);
        var strHTM = "";
        strHTM+='<li>';
        strHTM+='<div class="content_top_img">' +
            '<a href="">' +
            '<img class="lazy" src="'+datas[0]["0"].I_img1+'" alt="">' +
            '</a>' +
            '</div>';
        strHTM+='<div class="content_top_cot">';
        strHTM+=' <div class="content_top_cot_one">' +
            '<span>距离团购结束</span>' +
            '</div>';
        strHTM+=' <div class="content_top_cot_two">' +
            '<a href="">'+datas[0].g_descri;
        strHTM+='</a>';
        strHTM+='</div>';
        strHTM+='<div class="content_top_cot_three">';
        strHTM+='<p class="mlcb_price fl"><i>￥</i><span>'+datas[0].g_price+'</span><!--<del>￥150.00</del>--></p>';
        strHTM+='<p class="mlcb_btn fr">' +
            '<a class="put_cart embox" data="'+datas[0].g_data+'" pic="images/contenttop.jpg" href="javascript:void(0)">加入购物车</a>';
        strHTM+= '</p>';
        strHTM+='</div>';
        strHTM+='</div>';
        strHTM+= '</li>';
//        $("div").append(strHTM);

            var strhtml="";
            strhtml+='<li>';
            strhtml+='<div class="n_list_img">';
            strhtml+='<a href="">';
            strhtml+='<img class="lazy" src="'+datas[4]["0"].I_img1+'" alt="" height="100%" width="100%">';
            strhtml+= '</a>';
            strhtml+='<div class="hover_a">';
            strhtml+='<a href="" target="_blank">补水</a>';
            strhtml+='<a href="" target="_blank">保湿</a>';
            strhtml+='</div>';
            strhtml+='</div>';
            strhtml+='<div class="n_list_info">';
            strhtml+='<div class="name"><a href="">'+datas[4].g_descri+'</a></div>';
            strhtml+='<div class="info">';
            strhtml+='<p class="p1"><i>￥</i><span>'+datas[4].g_price+'</span>';
            strhtml+='<p class="p2"><a class="put_cart" href="javascript:void(0)">加入购物车</a></p>';
            strhtml+='</div>';
            strhtml+='<div class="tip">';
            strhtml+='<span>距团购结束2天10小时37分34秒</span>';
            strhtml+='</div>';
            strhtml+='</div>';
            strhtml+='</li>';
            $("ul").append(strhtml);
        })
    })
</script>